package com.kgc.storeprovider.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.store.pojo.InventoryLoss;
import com.kgc.store.remote.InventoryLossRemote;
import com.kgc.storeprovider.service.InventoryCheckService;
import com.kgc.storeprovider.service.InventoryLossService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class InventoryLossController implements InventoryLossRemote {

    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private InventoryLossService inventoryLossService;

    @Override
    public ResponseMsg getInventoryLossList(Map<String, Object> map) {
        logger.info("InventoryLossController getInventoryLossList map:"+map);
        ResponseMsg msg = inventoryLossService.getInventoryLossList(map);
        logger.debug("InventoryLossController getInventoryLossList msg:"+msg);
        return msg;
    }

    @Override
    public ResponseMsg delInventoryLoss(String code) {
        logger.info("InventoryLossController delInventoryLoss code:"+code);
        ResponseMsg msg = inventoryLossService.delInventoryLoss(code);
        logger.debug("InventoryLossController delInventoryLoss msg:"+msg);
        return msg;
    }

    @Override
    public ResponseMsg insertInventoryLoss(InventoryLoss inventoryLoss) {
        logger.info("InventoryLossController insertInventoryLoss inventoryLoss:"+inventoryLoss);
        ResponseMsg msg = inventoryLossService.insertInventoryLoss(inventoryLoss);
        logger.debug("InventoryLossController insertInventoryLoss msg:"+msg);
        return msg;
    }
}
